@page "{userName?}"
@model GithubProfileModel
@{
    ViewData["Title"] = "Github Profile";
}

<h1>GithubProfile</h1>

<form id="user-profile" method="post">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">Introduce a Github user name</h3>
        </div>
        <div class="panel-body">
            <div asp-validation-summary="All" class="text-danger"></div>
            <div class="form-group">
                <label asp-for="Input.UserName"></label>
                <input asp-for="Input.UserName" class="form-control" />
                <span asp-validation-for="Input.UserName" class="text-danger"></span>
            </div>
            <div class="form-group">
                <button type="submit" class="btn btn-default">Show user profile!</button>
            </div>
        </div>
    </div>
</form>

@if (Model.GithubUser != null)
{
    <label for="user-login" style="font-weight:bold">Login</label>
    <p id="user-login">@Model.GithubUser.Login</p>
    <label for="name" style="font-weight:bold">Name</label>
    <p id="name">@Model.GithubUser.Name</p>
    <label for="company" style="font-weight:bold">Company</label>
    <p id="company">@Model.GithubUser.Company</p>
}

